<template>
	<view class="main">
		<view v-if="type==1" class="content" @click="isShowZl=true">
			<image src="https://images.linglinggong.net/icon3/popupWatch/zl1.png" mode="aspectFill"></image>
			<text>{{`助力解禁(${num-count>=0?(num-count):0})`}}</text>
		</view>
		<view v-if="type==2" class="content" @click="yajin()">
			<image src="https://images.linglinggong.net/icon3/popupWatch/yj1.png" mode="aspectFill"></image>
			<text>{{`押金解禁(${deposit})`}}</text>
		</view>
		<view v-if="type==3" class="content" @click="fajin()">
			<image src="https://images.linglinggong.net/icon3/popupWatch/yj1.png" mode="aspectFill"></image>
			<text>{{`罚金解禁(${deposit}元)`}}</text>
		</view>
		<pay v-if="isShowPay" @closePayPage="closePayPage()" :info='payInfo' :price="deposit" :isPwd="false"
			:modalText1="'距离解封就差一步了'" :UnsealId="UnsealId"></pay>
		<jfzl v-if="isShowZl" @closerZl="closerZl()"></jfzl>
	</view>
</template>

<script>
	import pay from './jfpay.vue'
	import jfzl from './jf-zl.vue'
	export default {
		data() {
			return {
				type: 1,
				deposit: 0,
				payInfo: `1、支付解封金后立即解禁
				2、解封金一旦支付，恕不退还
				3、解封金只对本次有效，请切勿再次违规`,
				isShowPay: false,
				UnsealId: 0,
				num: 3,
				count: 0,
				isShowZl: false,
			}
		},
		components: {
			pay,
			jfzl,
		},
		methods: {
			fajin() {
				this.isShowPay = true
			},
			yajin() {
				this.isShowPay = true
			},
			closePayPage() {
				this.isShowPay = false
			},
			closerZl() {
				this.isShowZl = false
			},
		},
		beforeMount() {
			if (uni.getStorageSync('FengjinItem')) {
				this.type = uni.getStorageSync('FengjinItem').type
				// this.deposit = parseInt((uni.getStorageSync('FengjinItem').deposit) / 100)
				this.deposit = (uni.getStorageSync('FengjinItem').penalty) / 100
				this.UnsealId = uni.getStorageSync('FengjinItem').id
				this.num = uni.getStorageSync('FengjinItem').scheduleNumber
				this.count = uni.getStorageSync('FengjinItem').schedule
			}
		},
	}
</script>

<style lang="less" scoped>
	.main {
		// width: 200rpx;
		height: 56rpx;
		position: fixed;
		right: 0;
		top: 30vh;
		z-index: 10001;
	}

	.content {
		// width: 200rpx;
		height: 56rpx;
		background: #FE4B28;
		border-radius: 28rpx 0px 0rpx 28rpx;
		display: flex;
		align-items: center;

		&>image {
			margin-left: 6rpx;
			width: 45rpx;
			height: 45rpx;
		}

		&>text {
			margin-left: 10rpx;
			margin-right: 10rpx;
			font-size: 20rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #FFFFFF;
			line-height: 56rpx;
		}
	}
</style>
